from datetime import datetime
import os

today = datetime.now()

from_day = datetime.strptime('2021-01-18', '%Y-%m-%d')

days = (today - from_day).days + 1

dir_name = os.path.join(os.getcwd(), "Day{}".format(days))
if os.path.exists(dir_name):
    print("{} 已存在".format(dir_name))
else:
    os.makedirs(dir_name, exist_ok=True)
    print("{} 创建成功".format(dir_name))

file_name = os.path.join(dir_name, "mengfeiyuan.py")

if os.path.isfile(file_name):
    print("{} 文件已存在".format(file_name))
else:
    fs = open(file_name, 'w')
    fs.close()
    print("{} 文件创建成功".format(file_name))
